package com.yunxi.service.dubboService.impl.sto;

import com.github.pagehelper.PageInfo;
import com.yunxi.core.util.BeanTools;
import com.yunxi.model.sto.StoReceiveRecord;
import com.yunxi.service.localService.sto.StoReceiveRecordService;
import com.yunxi.sto.pojo.StoReceiveRecordQueryVO;
import com.yunxi.sto.pojo.StoReceiveRecordVO;
import com.yunxi.sto.service.StoReceiveRecordDubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import java.lang.reflect.InvocationTargetException;
import java.util.List;

/**
 * <p>
 * 渠道商车辆签收记录 服务实现类
 * </p>
 *
 * @author caoYong
 * @since 2019-06-10
 */
public class StoReceiveRecordDubboServiceImpl implements StoReceiveRecordDubboService {

    @Autowired
    @Qualifier(value = "stoReceiveRecordServiceImpl")
    StoReceiveRecordService stoReceiveRecordService;


    @Override
    public StoReceiveRecordVO getById(String id) {
        StoReceiveRecord stoReceiveRecord = stoReceiveRecordService.getById(id);
        StoReceiveRecordVO stoReceiveRecordVO = new StoReceiveRecordVO();
        BeanTools.copyProperties(stoReceiveRecordVO,stoReceiveRecord);
        return stoReceiveRecordVO;
    }

    @Override
    public void saveOrUpdate(StoReceiveRecordVO stoReceiveRecordVO){
        StoReceiveRecord stoReceiveRecord = new StoReceiveRecord();
        BeanTools.copyProperties(stoReceiveRecord,stoReceiveRecordVO);
        stoReceiveRecordService.saveOrUpdate(stoReceiveRecord);
    }

    @Override
    public void removeById(String id) {
    stoReceiveRecordService.removeById(id);
    }

    @Override
    public PageInfo<StoReceiveRecordQueryVO> findPageByVO(StoReceiveRecordQueryVO stoReceiveRecordVO, Integer pageNum, Integer pageSize) {
        PageInfo<StoReceiveRecordQueryVO> pageInfo = stoReceiveRecordService.pageByVo(stoReceiveRecordVO, pageNum, pageSize);
        return pageInfo;
    }

    @Override
    public void removeByListVo(List<StoReceiveRecordVO> stoReceiveRecordVOList) throws IllegalAccessException, InvocationTargetException, InstantiationException {
        stoReceiveRecordService.removeByListVo(stoReceiveRecordVOList);
    }
}
